package cn.chengpengper.shortlink.controller;

import cn.chengpengper.shortlink.service.CaptchaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author huchengpeng
 * @version v1.0.0
 * @date 2023/8/20 23:32
 * @description 图形验证码Controller
 */
@Slf4j
@Controller
@RequestMapping("/api/captcha/")
public class CaptchaController {

    @Autowired
    private CaptchaService captchaService;

    @GetMapping("v1/getCaptcha")
    public void getCaptcha(HttpServletRequest request, HttpServletResponse response) {
        captchaService.getImageCaptcha(request, response);
    }
}
